package com.unicloud.medical.oss.core.autoconfigure;

import com.unicloud.medical.oss.core.DefaultEndpoint;
import com.unicloud.medical.oss.core.OSSServiceFinder;
import com.unicloud.medical.oss.core.annotation.ExceptionInterceptorAspect;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureAfter(OSSCacheAutoConfiguration.class)
public class OSSServerAutoConfiguration {
    @Bean
    public OSSServiceFinder ossServiceFinder() {
        return new OSSServiceFinder();
    }

    @Bean
    public DefaultEndpoint defaultEndpoint() {
        return new DefaultEndpoint(ossServiceFinder());
    }

    @Bean
    public ExceptionInterceptorAspect exceptionInterceptorAspect() {
        return new ExceptionInterceptorAspect();
    }

}
